<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
  <caption>用户对象</caption>
  <tr>
    <th>用户名</th>
    <th>密码</th>
    <th>昵称</th>
  </tr>
</table>
<script>
  let arr=[{username:"张三",password:1111,nickname:"张"},
  {username:"李四",password:1111,nickname:"李"},
  {username:"王五",password:1111,nickname:"王"}];
  let table=document.querySelector("table");
  //遍历数组
  for (let user of arr) {
    let tr = document.createElement("tr");
    let usernameTd = document.createElement("td");
    let passwordTd = document.createElement("td");
    let nicknameTd = document.createElement("td");
    usernameTd.innerText = user.username;
    passwordTd.innerText = user.password;
    nicknameTd.innerText = user.nickname;
    tr.append(usernameTd,passwordTd,nicknameTd);
    //把tr装进table
    table.append(tr);
  }
</script>
</body>
</html>